var Candidate = {
	register: function() {
		ajax({
		  url: baseURL + "candidate/insert",
		  cache: false,
		  type: "POST",
		  data: $('#register_form').serialize(),
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	updateCandidate: function() {
		ajax({
		  url: baseURL + "candidate/update",
		  cache: false,
		  type: "POST",
		  data: $('#register_form').serialize(),
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	deleteSubscription: function(job_id) {
		ajax({
		  url: baseURL + "candidate/subscriptions/delete",
		  cache: false,
		  type: "POST",
		  data: 'id=' + job_id,
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	getGenre: function() {
		ajax({
			  url: baseURL + "ajax/get_genre",
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#personalGenre').html(data);
			  }
			});
	},
	
	getMaritalStatus: function() {
		ajax({
			  url: baseURL + "ajax/get_marital_status",
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#personalMaritalStatus').html(data);
			  }
			});
	},
	
	getDriveLicense: function() {
		ajax({
			  url: baseURL + "ajax/get_drive_license",
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#personalDriveLicense').html(data);
			  }
			});
	},
	
	getMessageGrid: function() {
		ajax({
			  url: baseURL + "candidate/message/search",
			  cache: false,
			  type: "POST",
			  data: 'offset=' + ($('#message_offset') ? $('#message_offset').val() : '0'),
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#gridMessage').html(data);
			  }
			});
	}
};